<?php

namespace App\Trip\Plane\Resp;

use App\Trip\Plane\Interfaces\Resp\CommonResponseInterface;
use App\Trip\Plane\Interfaces\Result\BeforeBookResultInterface;

class BeforeBookResponse implements CommonResponseInterface
{
    private BeforeBookResultInterface $res;

    public function __construct(BeforeBookResultInterface $bookResp)
    {
        $this->res = $bookResp;
    }

    /**
     * @inheritDoc
     */
    public function toArray(): array
    {
        return [
            'provider'        => $this->res->getProvider()->value,
            'passenger_rules' => $this->res->getPassengerRules(),
            'bookingTagKey'   => $this->res->getBookingTagKey(),
            'planes'          => $this->res->getPlanes(),
        ];
    }
}